/*
 * Copyright (c) 2011 Imre Fazekas.
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 *
 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 * Neither the name of the Brillien nor the names of its
 * terms and concepts may be used to endorse or promote products derived from this
 * software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

package com.vii.brillien.kernel.annotations;

import java.lang.annotation.*;

/**
 * Extra management information is provided through this annotation during the definition of a Presence type.
 * Like logging, logical name, state devision type name
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Inherited
public @interface PresenceService {

    final long  DEFAULT_TIMEMEASURE = -1;

    /**
     * All incoming communication will be logged with a synchronous message call to the Logger Presence instane
     */
    final int   LOGGED              = 1;

    /**
     * The operations of the Presence instance will be not logged at all.
     */
    final int   UNLOGGED            = 0;


    final String ALL                = "ALL";
    final String SEVERE             = "SEVERE";
    final String WARNING            = "WARNING";
    final String INFO               = "INFO";
    final String CONFIG             = "CONFIG";
    final String FINE               = "FINE";
    final String FINER              = "FINER";
    final String FINEST             = "FINEST";
    final String OFF                = "OFF";

    /**
     * Default value for messageExpiration property
     */
    final long   EXPIRATION_OFF         = -1;

    /**
     * Default logging type
     */
    final int    DEFAULT_LOG_TYPE       = LOGGED;

    /**
     * Default logging level
     */
    final String DEFAULT_LOG_LEVEL      = FINE;


    /**
     * Returns the components's published name
     * Default is the name of the Class
     * @return Presence's published name
     */
    String      name()                  default "";

    /**
     * Setter method for logging type 
     * @return logging type
     */
    int         logType()               default DEFAULT_LOG_TYPE;

    // ALL, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, OFF

    /**
     * Setter method for logging level of the Presence type. According to the logging type, all logged method will be logged at this level. 
     * @return logging level
     */
    String      logLevel()              default DEFAULT_LOG_LEVEL;

    /**
     * Setter method for full qualified name of the PresenceManager for instantiation process
     * @return name of presence manager
     */
    String      presenceManager()       default "";

    /**
     * Setter method for full qualified name of the StateDivision type
     * @return name of state division
     */
    String      stateDivision()         default "";

    /**
     * Timout for this component measured in milliseconds
     */
    long        timeMeasure()           default DEFAULT_TIMEMEASURE;

    /**
     * Tells whether the Presence has periodical aspiring activity
     */
    boolean     periodical()            default false;

    /**
     * Tells the expiration taken into account by the given Precense
     */
    long        messageExpiration()     default EXPIRATION_OFF;


    /**
     * Tells whether this presence represents an internal entity not to be published its services
     */
    boolean     internal()              default false;

}
